;;; straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name
        "straight/repos/straight.el/bootstrap.el"
        (or (bound-and-true-p straight-base-dir)
            user-emacs-directory)))
      (bootstrap-version 7))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://radian-software.github.io/straight.el/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))
(advice-add 'straight-vc-git--encode-url :around #'noalias-set-github-mirror)
(defun noalias-set-github-mirror (oldfunc &rest args)
   (let ((url (apply oldfunc args)))
      (replace-regexp-in-string (rx (group "github.com"))
                                "ghproxy.cc/https://github.com" url nil nil 1)))
(setq straight-vc-git-default-protocol 'https)


(provide 'init-straight)
